﻿@using Pay.Token.Utils
@model PagedResult<product_dto>
@{
    string site_img = ViewBag.img_url;
    //int userType = ViewBag.UserType;
    //long userId = ViewBag.UserId;
}
@{
    if (Model.rows.Count > 0) {
        foreach (var row in Model.rows) {
            @*<div class="item jumpDetail_btn" data-url="/DistributionMall/ProductDetail?productId=@row.id">
                    <div class="inner">
                        <div class="box">
                            <div class="img">
                                <img src="@(row.main_image_url)" />
                            </div>
                            <p class="tit">@row.name</p>
                            <div class="bottom mb20 mt20">
                                <em class="col-gray2 fn24">价格：</em>
                                <span class="col-red fn32">@row.price</span>
                                <em class="col-gray2 fn24">元</em>
                            </div>
                            <a class="ui-btn-share ui-btn-share-100 mb20">立即购买</a>
                        </div>
                    </div>
                </div>*@

            @*<li data-url="/DistributionMall/ProductDetail?productId=@row.id" class="jumpDetail_btn">
                <div class="imgsrc">
                    <img src="@(row.main_image_url)" alt="" />
                </div>
                <div class="content">
                    <p>@row.name</p>
                    <p></p>
                    <div class="price"><span>@row.price</span> <a href="/DistributionMall/ProductDetail?productId=@row.id" class="buybtn ">立即购买</a> </div>
                </div>

            </li>*@
            <div class="item" style="position: absolute; left: 0px; top: 0px;" data-url="/DistributionMall/ProductDetail?productId=@row.id">
                <a href="javascript:void(0)" >
                    <div class="itemBox">
                        <div class="img">
                            <img src="@(row.main_image_url)">
                        </div>
                        <div class="box">
                            <p class="tit">@row.name</p>
                            <div class="mb20">
                                <p>
                                    <em class="col-red fn20">￥</em>
                                    <span class="col-red fn32">@row.price.ToString("0.##")</span>
                                </p>
                            </div>
                            <a class="ui-btn-share ui-btn-share-100 fxPro" href="javascript:void(0)" >立即购买</a>
                        </div>
                    </div>
                </a>
            </div>
        }
    }

    <page total_pages="@Model.total_pages" rows="@Model.rows.Count()" total_result="@Model.total_result"></page>
}
@*<script src="~/Scripts/token-common.js"></script>*@
<script type="text/javascript">
    //$(function () {
    //    // 瀑布流
    //    $('.wall').jaliswall({ item: '.item' });
    //});
    @*$(".jumpDetail_btn").click(function () {

        try {
            var userId = Number('@userId');
            if (userId == 0) {
                var loginResult = isLogin();
                if (!loginResult)
                    return loginResult;
            }
        } catch (ex) { }
        var userType = Number('@userType');
        var jumpUrl = $(this).attr("data-url");

        window.location.href = jumpUrl;

        //if (userType >= 6) {
        //    swal({
        //        title: "您已经购买过该专区商品，是否继续购买？",
        //        showCancelButton: true,
        //        confirmButtonColor: "",
        //        confirmButtonText: "确定",
        //        cancelButtonText: "取消",
        //        closeOnConfirm: true
        //    },
        //        function (isConfirm) {
        //            if (isConfirm) {
        //                window.location.href = jumpUrl;
        //            } else {
        //                swal({
        //                    title: "",
        //                    text: "",
        //                    type: ""
        //                });
        //                return false;
        //            }

        //        });
        //} else {
        //    window.location.href = jumpUrl;

        //}
    });*@

</script>

